<script type="text/javascript" src="../../repo/files/%3Apublic%3Aplugin-samples%3Apentaho-cdf%3A30-documentation%3A30-component_reference%3Asamples.js"></script>
<div class="shadow">

  <div class="contents">

    <h2>ContentListComponent</h2>

    <h3>Description</h3>
    <p>
      This component generates a content list containing the current solution folder/subfolders and files.
      <br/>Note: To hide undesired folders edit index.properties and set the property "visible" to false. 
    </p>

    <h3>Options</h3>
    
    <dl class="documentation">
      <dt>name</dt>
      <dd>The name of the component</dd>

      <dt>type</dt>
      <dd><code>contentList</code></dd>

      <dt>listeners</dt>
      <dd><i>Array - </i> Parameters who this component will react to</dd>

      <dt>htmlObject</dt>
      <dd>Id of the component (usually a div or a span tag) to be replaced by the result</dd>

      <dt>executeAtStart</dt>
      <dd>True to execute the component at start, false otherwise</dd>
      
      <dt>mode</dt>
      <dd>It's possible to choose between 1 (Files only), 2 (Folders only) , 3 (Files and folders) and 4(Parent folders). Default value: 3 </dd>
    </dl>

    <h3>Sample</h3>

    <div id="example" class="flora">
      <ul>
        <li><a href="#sample"><span>Sample</span></a></li>
        <li><a href="#code"><span>Code</span></a></li>
      </ul>
      <div id="sample">
        <div id="sampleObject"></div>
        <br/>
      </div>

      <div id="code">
        <textarea cols="80" rows="40" id="samplecode">
require(['cdf/Dashboard.Blueprint', 'cdf/components/ContentListComponent'],
  function(Dashboard, ContentListComponent) {

    var dashboard = new Dashboard();

    dashboard.addComponent(new ContentListComponent({
      name: "folderContentComponent",
      type: "contentList",
      listeners:[],
      htmlObject: "sampleObject",
      executeAtStart: true,
      mode: "3"
    }));
    dashboard.init();
});
        </textarea>
        <br/>
        <button id="tryMe">Try me</button>
      </div>
    </div>
  </div>
</div>
